package obj

import (
	"showen/num"
	"testing"
)

func TestVectorObject(t *testing.T) {
	// Test creating a vector with some elements
	elements := []Object{
		&NumberObject{Value: num.Integer(1)},
		&NumberObject{Value: num.Integer(2)},
		&StringObject{Value: "hello"},
	}

	vector := &VectorObject{Elements: elements}

	// Test Type method
	if vector.Type() != VECTOR_OBJ {
		t.Errorf("vector.Type() = %v, want %v", vector.Type(), VECTOR_OBJ)
	}

	// Test Inspect method
	expected := "#(1 2 \"hello\")"
	if vector.Inspect() != expected {
		t.Errorf("vector.Inspect() = %v, want %v", vector.Inspect(), expected)
	}

	// Test empty vector
	emptyVector := &VectorObject{Elements: []Object{}}
	expectedEmpty := "#()"
	if emptyVector.Inspect() != expectedEmpty {
		t.Errorf("emptyVector.Inspect() = %v, want %v", emptyVector.Inspect(), expectedEmpty)
	}
}
